home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_085 / lowmem / lmss.asm < prev    next >
Assembly Source File  |  1992-05-06  |  2KB  |  80 lines

  1. ; :ts=8
  2.  
  3. ;
  4. ; C Language Interface Routines For Low-Memory Server Library
  5. ;
  6. ; Copyright 1987 By ASDG Incorporated
  7. ;
  8. ; For non-commercial distribution only. Commercial distribution
  9. ; or use is strictly  forbidden except under license from ASDG.
  10. ; Author: Perry S. Kivolowitz
  11. ; ASDG shall in no way be held responsible for any damage or loss
  12. ; of data which may result from the use or misuse of this program
  13. ; or data. ASDG makes no warranty with respect to the correct and
  14. ; proper functioning of this code or data. However, it is the be-
  15. ; lief of ASDG that this  program and  data is  correct and shall
  16. ; function properly with correct use.
  17. ;
  18. ; These modules were written for  use  with  Manx C.  Manx C is a
  19. ; product  of  the  Manx  Software Systems company whose language
  20. ; tools are used  exclusively by  ASDG  for all its software pro-
  21. ; ducts. Yes - this is an unsolicited plug for Manx - Perry K.
  22. ;
  23.     dseg
  24. ;
  25. ; you must provide  a LowMemBase  in your  C programs similar in
  26. ; concept to ExecBase or IntuitionBase etc.
  27. ;
  28.  
  29.     public    _LowMemBase
  30.  
  31. ;
  32. ; RegLowMemReq
  33. ;
  34. ; Register a message port with the low-memory notification service. From
  35. ; C this routine would be called as in:
  36. ;
  37. ;    res = RegLowMemReq(PortName , Space)
  38. ;                  A0        A1
  39. ;    where:
  40. ;
  41. ;    PortName is  a pointer  to a null terminated string representing 
  42. ;         the name  of  your port to which the low-memory service
  43. ;         will attempt to send a message.
  44. ;    Space     is a pointer to an initialized LowMemMessage.
  45. ;
  46. ;    res     if false means  your  registration has  been  accepted.
  47. ;         Currently, the only  reason  your  request would be re-
  48. ;         jected is  if  the  low-memory server itself ran out of 
  49. ;         memory (oh my!) or the port name  you requested has al-
  50. ;         ready been registered. The value of the returned  error
  51. ;         code can be used to determine why the call failed.
  52. ;
  53.  
  54.     cseg
  55.     public    _RegLowMemReq
  56.  
  57. _RegLowMemReq
  58.     move.l    4(sp),a0    ; load PortName into a0
  59.     move.l    8(sp),a1    ; load Space into a1
  60.     move.l    _LowMemBase,a6    ; load library pointer
  61.     jmp    -30(a6)        ; actually make call
  62.  
  63. ;
  64. ; DeRegLowMemReq
  65. ;
  66. ; Undo the effect of a previous RegLowMemReq. You absolutely positively
  67. ; must call this routine before  exiting  your program (or  closing the
  68. ; library) 
  69. ;
  70. ;    
  71.     public    _DeRegLowMemReq
  72.  
  73. _DeRegLowMemReq
  74.     move.l    4(sp),a0    ; load PortName into a0
  75.     move.l    _LowMemBase,a6    ; load library pointer
  76.     jmp    -36(a6)        ; actually make call
  77.  
  78.